<template>
  <div>
    <el-dialog
      v-model="show"
      title="评审意见和建议"
      width="45vw"
      destroy-on-close
      @close="handleCancel"
    >
    <el-form label-width="140px">
      <el-row class="mg-row">
        <el-col :span="24" class="mg-row">
          <div>评审结论</div>
        </el-col>

        <el-col :xl="16" :lg="24">
          <el-form-item label="综合评审结论">
             <el-select
               style="width: 100%"
               v-model="reviewDetail.reviewCommentsCode"
               clearable
               value-key="dicCode"
               disabled
             >
               <el-option
                 v-for="item in reviewConclusion"
                 :key="item.dicCode"
                 :label="item.dicValue"
                 :value="item.dicCode"
               ></el-option>
             </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 技术专家 -->
      <el-row v-if='reviewDetail.expertCategoryCode ==1'>
        <el-col :span="24" class="mg-row">
            <div>评审意见</div>
        </el-col>
        <!-- 项目立项 -->
        <div v-if="reviewDetail.reviewStageCode==2">
          
          <el-col :xl="16" :lg="24">
            <el-form-item label="创新性">
              <el-input type="textarea" v-model="reviewDetail.tcnInnovation" disabled />
            </el-form-item>
          </el-col>

          <el-col :xl="16" :lg="24">
            <el-form-item label="必要性">
              <el-input type="textarea" v-model="reviewDetail.tcnAdvance" disabled />
            </el-form-item>
          </el-col>

          <el-col :xl="16" :lg="24">
            <el-form-item label="创造价值">
              <el-input type="textarea" v-model="reviewDetail.tcnJbzx" disabled />
            </el-form-item>
          </el-col>
          <el-col :xl="16" :lg="24">
            <el-form-item label="可行性">
              <el-input type="textarea" v-model="reviewDetail.ext1" disabled />
            </el-form-item>
          </el-col>
          <el-col :xl="16" :lg="24">
            <el-form-item label="团队能力">
              <el-input type="textarea" v-model="reviewDetail.ext2" disabled />
            </el-form-item>
          </el-col>
        </div>
        <!-- 项目验收 -->
        <div v-else-if="reviewDetail.reviewStageCode==4">
          <el-col :xl="16" :lg="24">
            <el-form-item label="项目完成情况">
              <el-input type="textarea" v-model="reviewDetail.ext3" disabled />
            </el-form-item>
          </el-col>
          <el-col :xl="16" :lg="24">
            <el-form-item label="项目产出">
              <el-input type="textarea" v-model="reviewDetail.ext4" disabled />
            </el-form-item>
          </el-col>
          <el-col :xl="16" :lg="24">
            <el-form-item label="成果影响">
              <el-input type="textarea" v-model="reviewDetail.ext5" disabled />
            </el-form-item>
          </el-col>
          <el-col :xl="16" :lg="24">
            <el-form-item label="综合管理">
              <el-input type="textarea" v-model="reviewDetail.ext6" disabled />
            </el-form-item>
          </el-col>
        </div>
        <!-- 其他项目阶段 -->
        <div v-else>
          <el-col :xl="16" :lg="24">
            <el-form-item label="创新性">
              <el-input type="textarea" v-model="reviewDetail.tcnInnovation" disabled />
            </el-form-item>
          </el-col>

          <el-col :xl="16" :lg="24">
            <el-form-item label="必要性">
              <el-input type="textarea" v-model="reviewDetail.tcnAdvance" disabled />
            </el-form-item>
          </el-col>

          <el-col :xl="16" :lg="24">
            <el-form-item label="创造价值">
              <el-input type="textarea" v-model="reviewDetail.tcnJbzx" disabled />
            </el-form-item>
          </el-col>
        </div>
      </el-row>

      <!-- 经济专家 -->
      <el-row v-if='reviewDetail.expertCategoryCode ==2'>
        <el-col :span="24" class="mg-row">
           <div>评审意见</div>
        </el-col>

        <el-col :xl="16" :lg="24">
          <el-form-item label="经济性">
            <el-input type="textarea" v-model="reviewDetail.ecoRational" disabled />
          </el-form-item>
        </el-col>

        <el-col :xl="16" :lg="24">
          <el-form-item label="符合性">
            <el-input type="textarea" v-model="reviewDetail.ecoAccurate" disabled />
          </el-form-item>
        </el-col>

        <el-col :xl="16" :lg="24">
          <el-form-item label="相关性">
            <el-input type="textarea" v-model="reviewDetail.ecoCompliance" disabled />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :xl="16" :lg="24">
          <el-form-item label="对本项目的建议">
            <el-input type="textarea" v-model="reviewDetail.reviewComments" disabled />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :xl="16" :lg="24">
          <el-form-item label="附件">
            <ecm-upload v-if="reviewDetail.reviewAttachment&&reviewDetail.reviewAttachment!='[]'"
              :files="reviewDetail.reviewAttachment?JSON.parse(reviewDetail.reviewAttachment):[]"
              :docid="docid" disabled
            ></ecm-upload>
            <span v-else>无</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    </el-dialog>
  </div>
</template>
<script lang="ts">
  import EcmUpload from "/@/components/ecmUpload/index.vue";
  import {defineComponent} from "vue";
  
  export default defineComponent({
    name: "approveDialog",
    props: {
      reviewDetail: {
        type: Object,
        default: ()=>{}
      }
    },
    components: {
      EcmUpload
    },
    emits: ["handleCancel"],
    setup(props, { emit }) {
      console.log(props)
      let docid = window["ecmDocType"].project;
      const show = true;
      const reviewConclusion = [
        {dicCode:"1",dicValue:"同意立项"},
        {dicCode:"2",dicValue:"需重新评议"},
        {dicCode:"3",dicValue:"不同意立项"},
      ];
      const handleCancel = async()=>{
        emit("handleCancel");
      };
      return {
        reviewConclusion,
        show,
        handleCancel,
        docid
      };
    }
  })

</script>
<style lang="scss" scoped></style>
